
//声明 reducer 函数
let zanReducer = (state=0, action) => {
  //根据 action 的类型来更新 state 的值
  switch(action.type){
    case 'incre':  //increment 增加
      return state + 1;
    default:
      return state;
  }
}

//暴露
export default zanReducer;

//封装同步的 action creator
export let increAction = () => ({type: 'incre'})